.photo-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.photo-preview-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.photo-preview-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.photo-preview-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.photo-preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.photo-preview-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.photo-preview-nav.prev {
  left: 15px;
}

.photo-preview-nav.next {
  right: 15px;
}

.photo-preview-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.photo-preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 255, 255, 0.3);
  border-top: 3px solid #00ffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.photo-preview-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
  color: rgba(255, 255, 255, 0.7);
}

.error-icon {
  font-size: 4rem;
}

.photo-preview-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: 70vh;
  margin-bottom: 20px;
}

.photo-preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.photo-preview-image.gif {
  object-fit: contain;
  animation: fadeIn 0.3s ease-in-out;
}

.photo-preview-image-container {
  position: relative;
  display: inline-block;
}

.photo-preview-image-container.live-photo .photo-preview-image {
  cursor: pointer;
}

.photo-preview-image-container.live-photo .photo-preview-image:hover {
  transform: scale(1.02);
}

.live-photo-indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  z-index: 10;
}

.live-photo-indicator:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.05);
}

.live-photo-icon {
  font-size: 16px;
  animation: pulse 2s infinite;
}

.live-photo-text {
  font-size: 12px;
  font-weight: 500;
}

.live-photo-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 8px;
  overflow: hidden;
}

.live-photo-effect {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
  opacity: 0;
  animation: livePhotoShimmer 3s infinite;
}

.photo-preview-image.live-playing {
  animation: livePhotoBreathe 3s infinite alternate;
}

@keyframes livePhotoShimmer {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(1.05);
  }
}

@keyframes livePhotoBreathe {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.02);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.photo-preview-video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.photo-preview-info {
  text-align: center;
  color: white;
  max-width: 100%;
}

.photo-preview-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  word-break: break-word;
}

.photo-preview-date {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 5px;
}

.photo-preview-album {
  font-size: 0.9rem;
  color: #00ffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-preview-album:hover {
  color: #00cccc;
  text-decoration: underline;
}

.photo-preview-actions {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 30px;
  backdrop-filter: blur(10px);
}

.photo-preview-action {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.photo-preview-action:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .photo-preview-overlay {
    padding: 10px;
  }
  
  .photo-preview-container {
    max-width: 95vw;
    max-height: 95vh;
  }
  
  .photo-preview-close {
    width: 35px;
    height: 35px;
    font-size: 20px;
    top: 10px;
    right: 10px;
  }
  
  .photo-preview-nav {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
  
  .photo-preview-nav.prev {
    left: 10px;
  }
  
  .photo-preview-nav.next {
    right: 10px;
  }
  
  .photo-preview-content {
    padding: 15px;
  }
  
  .photo-preview-title {
    font-size: 1.2rem;
  }
  
  .photo-preview-actions {
    bottom: 15px;
    gap: 10px;
    padding: 8px 15px;
  }
  
  .photo-preview-action {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .photo-preview-container {
    max-width: 98vw;
    max-height: 98vh;
  }
  
  .photo-preview-close {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
  
  .photo-preview-nav {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
  
  .photo-preview-content {
    padding: 10px;
  }
  
  .photo-preview-title {
    font-size: 1rem;
  }
  
  .photo-preview-date {
    font-size: 0.9rem;
  }
  
  .photo-preview-album {
    font-size: 0.8rem;
  }
  
  .photo-preview-actions {
    gap: 8px;
    padding: 6px 12px;
  }
  
  .photo-preview-action {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
}